package com.wteam.controller;


import com.wteam.PoJo.DO.user;
import com.wteam.PoJo.DTO.UpUserDTO;
import com.wteam.PoJo.VO.signVO;
import com.wteam.Service.IUserService;
import com.wteam.until.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.List;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author author
 * @since 2024-07-16
 */
@RestController
@RequestMapping("/member")
@Api(tags = "用户模块")
public class UserController {
    @Autowired
    private IUserService iUserService;

    @ApiOperation(value = "每日签到换积分")
    @GetMapping("/Signpoint")
    public Result signpoint() {
        return iUserService.signpoint();
    }

    @ApiOperation(value = "查看本月的签到情况")
    @GetMapping("/selectsign")
    public Result<List<signVO>> SelectSign() {
        return iUserService.selectsign();
    }

    @ApiOperation(value = "用户详细信息")
    @GetMapping("/userdetial")
    public Result<user> userdetial() {
        return iUserService.selectdetial();
    }


    @ApiOperation(value = "编辑用户信息")
    @PostMapping("/updateme")
    public Result updateme(@RequestBody @Validated UpUserDTO upUserDTO) throws IOException {
        return iUserService.updateme(upUserDTO);
    }

}
